﻿@model QRCodeForRealEstate.Models.AgentQRCode

@{
    ViewBag.Title = "Edit";
}

<h2>Edit</h2>

@using (Html.BeginForm()) {
    @Html.AntiForgeryToken()
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>AgentQRCode</legend>

        @Html.HiddenFor(model => model.ID)
        @Html.HiddenFor(model => model.QRCode)

        <div class="editor-label">
            @Html.LabelFor(model => model.AgentUserName)
        </div>
        <div>
            <h2>@Model.AgentUserName</h2>
        </div>


        @if (ViewBag.QRCodeLocation != "")
        {
            <a href= "@Url.Content(ViewBag.QRCodeLocation)"> QR Code </a>
            <br />
        }

        @if (ViewBag.BusinessCardLocation != "")
        {
            <a href= "@Url.Content(ViewBag.BusinessCardLocation)"> Business Card </a>
            <br />
        }

        @if (ViewBag.FlyerLocation != "")
        {
            <a href= "@Url.Content(ViewBag.FlyerLocation)"> Flyer </a> 
            <br />
        }
        

        @if (User.Identity.Name == "admin")
        {
            
         <div class="editor-label">
            @Html.LabelFor(model => model.Active)
        </div>    
            
        <div class="editor-field">
            @Html.EditorFor(model => model.Active)
            @Html.ValidationMessageFor(model => model.Active)
        </div>
        }

        <p>
            @{if(@Model.QRCode == null){ 
            <input type="submit" value="Create QR Code" />
            }
            else
            {
                <input type="submit" value="Modify BC and Flyer" />
            }
            }

        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}
